/*
 * @Author: 啊彪
 * @Date: 2021-05-28 16:35:23
 * @LastEditors: 啊彪
 * @LastEditTime: 2021-07-29 12:05:48
 * @Description: 留存数据
 * @FilePath: \boss\src\model\stats\retain.model.ts
 */
import mongoose from 'mongoose';

const Schema = mongoose.Schema;
const RetainSchema: mongoose.Schema = new Schema({
    date: { type: String, display: '日期', index: true },
    DNU: { type: Number, display: '新创建用户数量', default: 0 },
    DAU: { type: Number, display: '日活跃用户(登录)', default: 0 },
    secondStay: { type: Number, display: '次留人数', default: 0 },
    secondStayRate: { type: Number, display: '次留(%)', default: 0 },
    threeStay: { type: Number, display: '三留人数', default: 0 },
    threeStayRate: { type: Number, display: '三留(%)', default: 0 },
    sevenStay: { type: Number, display: '七留人数', default: 0 },
    sevenStayRate: { type: Number, display: '七留(%)', default: 0 },
    fifteenStay: { type: Number, display: '十五留人数', default: 0 },
    fifteenStayRate: { type: Number, display: '十五留(%)', default: 0 },
    thirtyStay: { type: Number, display: '三十留人数', default: 0 },
    thirtyStayRate: { type: Number, display: '三十留(%)', default: 0 },
    totalFlow: { type: Number, display: '总流水', default: 0 },
    ARPU: { type: Number, display: '活跃ARPU(平均每用户收入)', default: 0 },
    ARPPU: { type: Number, display: '付费ARPU(平均每付费用户收入)', default: 0 },
    RATE: { type: Number, display: '付费率', default: 0 },
}).index({ roleId: 1, loginDate: 1 });

const Retain = mongoose.model('Retain', RetainSchema);
export default Retain;